refactor oauth_api code