changed the sending data to a JSON object