Added ajax function for getting json data.