added setBearerToken to returned object, so that it is a "public function"