This fixes JSON issues #228 and #229 

I changed the way decoding happens for deserialized content such as application/json.