public function listAction(Request $request)
    {
        $objects = $this->get('doctrine.orm.default_entity_manager')->getRepository($request->get('class'))->findAll();
        // Fix for FOSRestBundle use
        if ($this->container->has('jms_serializer')) {
            return new Response($this->get('jms_serializer')->serialize($objects, 'json', SerializationContext::create()->setGroups(array('Default'))));
        }

        return new JsonResponse($objects);
    }