Completion and deletion implemented, refactored code for better API access.