Implemented delete() and query()