adding a tree API