Adding database pruning functionallity with deleteOldDatabaseEntries