Change the connection format to json, update the register and login process