wrote api test for tree_builder