sends bad request instead of 500 for bad JSON data