Clear statistics if necessary (e.g. when periods are deleted). Make statistics work in API even if insufficient data.