code added to pull stats through consumed API