data parameter is overwritten with JSON decoded data, even on failure

Discovered by @rachelbaker.

If you pass `data[title]=Hello%20World` in the POST body, the `data` parameter internally gets overwritten with the result of `json_decode`. We should check `json_last_error` and skip if it's non-zero.