update hierarchy_union view
add util for returning json
basic tree query