re-use a single json.Encoder