Raise JSON error on invalid POST requests.