updated protocol to use json.stringify
added more tests for json methods