Directory hierarchy API and query with directory filters