Added try catch in json response