handle "badParams" and "badJSON" errors