test full JSON roundtrip