code: public function getAction()
      {
          $id = $this->getPageId();
          if ($id !== null) {
              $result = $this->pageList->getPage($id)->getJSON();
          } else {
              $result = array();
              foreach ($this->pageList->getPages() as $pageName) {
                  $result[] = $this->pageList->getPage($pageName)->getJSON();
              }
          }
          $this->environment->sendJSONResult($result);
      }
docs: Yields a list of pages or a single page, if a page name is specified in the service name.