public function call(Request $request)
    {
        if($request !== $this->getRequestStack()->getCurrentRequest()){
            $this->getRequestStack()->push($request);
        }

        if(!$request->getRequestFormat(null) && $request->getAcceptableContentTypes()){
            $request->setRequestFormat($request->getFormat($request->getAcceptableContentTypes()[0]));
        }

        $response = $this->getRouter()
                ->find($request)
                ->call($this->getServices());

        if($response instanceof Response){
            return $response;
        }
        return new Response($response);
    }