User authentication and api handeling for sails.js