public function __invoke(array $input) { $this->stories = new \stories($this->shiftModel, $this->userModel, $this->tokensModel, $this->token); if (!empty($input['employeeID'])) { $employeeID = $input['employeeID']; $managers = $this->stories->getManagersByEmployeeID($employeeID); } else { throw new \Exception('improper API usage'); } return (new Payload())->withStatus(Payload::OK)->withOutput(['managers' => $managers]); }