db cleanup and working on getallentries