API, controller and test suite for tree nodes; moved generic rest handling function for controllers into someutils