How should route handlers distinguish malformed JSON from internal errors?