Implemented delete document functionality