fix page tree api and add test