errors should all be in json format