finished the statistics API