public function run($id = null)
    {
        $app = $this->getApp();
        if ($app->getRequest()->getMethod() !== 'OPTIONS') {
            $app->getResponse()->setStatusCode(405);
        }
        $options = $id === null ? $this->collectionOptions : $this->resourceOptions;
        $app->getResponse()->getHeaderCollection()->set('Allow', implode(', ', $options));
        $app->getResponse()->getHeaderCollection()->set('Access-Control-Allow-Method', implode(', ', $options));
    }