oauth2 api endpoint & better template