update GetAccessToken to return error