added some comments, fixed type for node api