public function createContainerAction(Request $request)
    {
        $content = $this->findContentByRequest($request);
        $type = $request->request->get('type', null);

        try {
            $container = $this->getEditor()->createDefaultContainer($type, [], $content);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        $this->validate($content);
        $this->persist($content);

        $viewBuilder = $this->getViewBuilder();

        $data = [
            'created' => $viewBuilder->buildContainer($container)->getAttributes()->getId(),
            'content' => $viewBuilder->buildContent($content),
        ];

        return $this->buildResponse($data, self::SERIALIZE_FULL);
    }