public static function handleRequest() { $GLOBALS['Session']->requireAuthentication(); if ($endpointHandle = static::shiftPath()) { if (!($Endpoint = Endpoint::getByHandle($endpointHandle))) { return static::throwNotFoundError('Endpoint not found'); } return static::handleEndpointRequest($Endpoint); } return static::respond('subscriptions', ['data' => Subscription::getAllByField('PersonID', $GLOBALS['Session']->PersonID)]); }