and use the encoder when marshalling json