Fix for diffs

We were passing the diff as an encoding string to the api. This passes the json dict instead.