logIn($_POST['email'], $_POST['password']); if ($token !== false) { return Response::out(array( 'data' => $token, 'error' => false, ), 200); } return Response::out(array( 'data' => 'Could not log in: incorrect data', 'error' => true, ), 400); } return Response::out(array( 'data' => 'Could not log in: required information missing', 'error' => true, ), 500); } }