Refactored add and delete commands for nodes and edges