fix typo, clean up api
fixed bug removing nodes