pass error back in json format