throw errors on invalid JSON explicitly using validate from jsonlite