implement tree rebuilder
make sure, that nodes, that user wants to manupiulate are in sync with db