bug fixes at server side
also, js client app is updated to show the dynamic tree structure.