Added database purge
Started database purge functionality