change in callback function to pass error json data