rudimentary protocol json serialization