Fixed bug in /api/login