Switched from MongoDB to MySQL, changed login to return JSend JSON rather than do redirects.