Add listNodes and error handling