log DB queries, populate tree on click