getRoot gets the top level parent of a given node id.