Move API call handling to it's own file
Fix tasks.js not initializing when no user has logged in