decouping oauth2 and api implement