catch invalid values passed to API methods and return JSON errors rather issuing 500s and emailing the site maintainer