public function getResult(Request $request)
 {
     $listingRequest = new ItemTypesListingRequest();
     // TODO: strict validation of arguments
     $listingRequest->setPerPage((int) $request->get('per_page', 100));
     $listingRequest->setPage((int) $request->get('page', 1));
     $itemTypes = $this->apiFactory->newListItemTypesUseCase()->listItemTypes($listingRequest);
     $response = $this->app->json($this->getSerializedTypes($itemTypes));
     (new PaginationHeaderSetter($response->headers))->setHeaders($request->getUriForPath('/items/types'), $listingRequest, count($itemTypes));
     return $response;
 }