Update api.py

User login failure return code as 401.