Refactoring to Oauth2 api support. Logic moved to Sinatra extension