Changed getMinMax function to return Json formatted string