Add deleteDoc function, getStats. Fix pagination issue with missing resu...

...lts