added json login and registration