PageService.php
public function postAction()
    {
        $request = $this->environment->getRequestHelper();
        $id = $request->getIdentifierParam('name');
        try {
            $this->pageList->getPage($id);
        } catch (InvalidParameterException $e) {
            $page = $this->pageList->addPageFromRequest($id, $request);
            $this->environment->sendJSONResult($page->getJSON());
            return;
        }
        throw new InvalidParameterException("Page already exists");
    }
public function postAction()
    {
        $request = $this->environment->getRequestHelper();
        $id = $request->getIdentifierParam('name');
        try {
            $this->pageList->getPage($id);
        } catch (InvalidParameterException $e) {
            $page = $this->pageList->addPageFromRequest($id, $request);
            $this->environment->sendJSONResult($page->getJSON());
            return;
        }
        throw new InvalidParameterException("Page already exists");
    }
Creates a new page