Moved Session-related exit_with_result() and exit_with_error() from APIUser.php to Session.