Initial version of json error handling