update the delete() node api so it's more efficient and clear
TODO: implement api tests