Added function to fetch data for chart, added function that returns data to draw chart