new stats api and mongodb integration