added functions for crud operations on documents