MODE-2251: Validate references before delete node

This PR does check that node does not references other node before allow to delete node.