Added json login with error message.