reject api calls that return invalid JSON