Redo rest infrastructure to support clients.  Factor out transitive closure algorithm.