Send proper error message for malformed JSON input