preparing the database and api for statistics