private function getEventObject(Event $event)
    {
        // get the service name
        list ($serviceName) = explode(":", $event->getRequest()->get('_controller'));

        // get the controller which handles this request
        if ($this->container->has($serviceName)) {
            $controller = $this->container->get($serviceName);
            $restEvent = $this->restEvent;
            $restEvent->setRequest($event->getRequest());
            $restEvent->setResponse($this->response);
            $restEvent->setController($controller);

            $returnEvent = $restEvent;
        } else {
            $returnEvent = $event;
        }

        return $returnEvent;
    }