Map nodes to objects and serialize as JSON