public function postAction(Request $request, $parent = null)
    {
        try {
            $keyWordLabel = trim($request->request->get('keyword'));
            $uid = $request->request->get('uid', null);
            if (null !== $uid) {
                $keywordItem = $this->getKeywordRepository()->find($uid);
                $keywordItem->setKeyWord($keyWordLabel);
            } else {
                $keywordItem = new KeyWord();
                $keywordItem->setKeyWord($keyWordLabel);
                if (null === $parent) {
                    $parent = $this->getKeywordRepository()->getRoot();
                }

                if ($this->keywordAlreadyExists($keyWordLabel)) {
                    throw new BadRequestHttpException('KEYWORD_ALREADY_EXISTS');
                }
                $keywordItem->setParent($parent);
                $this->getKeywordRepository()->insertNodeAsLastChildOf($keywordItem, $parent);
            }

            $this->getEntityManager()->persist($keywordItem);
            $this->getEntityManager()->flush();

            $response = $this->createJsonResponse(null, 201, [
                'BB-RESOURCE-UID' => $keywordItem->getUid(),
                'Location' => $this->getApplication()->getRouting()->getUrlByRouteName(
                    'bb.rest.keyword.get',
                    [
                        'version' => $request->attributes->get('version'),
                        'uid' => $keywordItem->getUid(),
                    ],
                    '',
                    false
                ),
            ]);
        } catch (\Exception $e) {
            $response = $this->createErrorResponse($e);
        }

        return $response;
    }