redirect when not logged in in api.js