Changed login to handle json body
* Changed to use Json formats where appropriate
* Changed matches to maps