Hmm.. you should probably use JsonCodec for this. See, for instance, QueryRunner as an example