Raise 400 for invalid JSON

Currently, if `json_decode` fails, no error is raised; `json_decode` simply returns `null`. We should detect if errors occurred, and, if so, raise a 400 status.