Create middleware to catch incoming JSON parse errors.