added database, oauth2 support