public function sendMessage(Request $request) {
        /** @var MessageHelper $messageHelper */
        $messageHelper = $this->container->get('sopinet_chatbundle_messagehelper');

        /** @var ApiHelper $apiHelper */
        $apiHelper = $this->container->get('sopinet_apihelperbundle_apihelper');

        /** @var Message $messageClassObject */
        try {
            $messageClassObject = $messageHelper->getMessageClassObject($request->get('type'));
        } catch(Exception $e) {
            throw new Exception($e->getMessage());
        }

        $formClassString = $messageClassObject->getMyForm();

        $formClassObject = new $formClassString($this->container, $request);
        $form = $this->container->get('form.factory')->create($formClassObject, $messageClassObject);

        /** @var Form $form */
        $form = $apiHelper->handleForm($request, $form);

        // TODO: Añadir comprobación en el FORM de que el Usuario pertenece al Chat indicado y de que dispone
        // es el dueño del Device que se ha especificado.
        if ($form->isValid()) {
            $em=$this->container->get('doctrine.orm.default_entity_manager');

            $em->persist($messageClassObject);
            $em->flush();

            // Send Message
            $messageHelper->sendMessage($messageClassObject);

            return $messageClassObject;
        } else {
            throw new Exception($form->getErrorsAsString());
        }
    }