public function onKernelLateRequest(GetResponseEvent $e)
    {
        if (!$this->enabled) return;

        $req = $e->getRequest();
        if (!$config = $req->attributes->get('_ac_web_service', false)) {
            return;
        }

        $config = $this->negotiateResponseFormat($req, $config);

        $req->attributes->set('_ac_web_service', $config);

        if (!isset($this->formatHeaders[$config['http_response_format']])) {
            throw new HttpException(415);
        }

        $e->getDispatcher()->dispatch(self::API_REQUEST, $e);
    }