Saving stats in DB

time to implement updateAggregateStatistics()