adds rescue methods to return json instead of error