Fixed bug in handling json response.