public function user_logout() { if (!$this->_user_id) { throw new Exception("no token sent which likely means theres no user logged in", 400); } require_once '../oauth/oauth_class.php'; $auth = new oauth_server(); if ($auth->destroy_token($this->_user_id)) { return array('data' => "log out successful", 'status' => '200'); } else { return array('data' => "error in logging out", 'status' => '200'); } }