Added API factory and user authentication function with Heroku.