Added functions to format data in ajax load