I don't think the changes here are correct.  I think that instead of keeping around another structure, you should instead just convert in this function.  It may require deserializing and then converting to json.  @pfarner may have a similar opinion, but hopefully he'll see this.