cleanup
toJson for node
tree to json