add 'authorize' function back to api.js for manually triggering authentication.