API addition in tree-fun