Added code to fetch stats from API