Converting to all JSON communication between client and server