login api working. yet to test register. API now outputs json error response as well.