Added the function to create a json to send to the db for logging in.