API: add node output and improve error handling

Change-Id: I3e32ab768115e6d92403373f454926fe3b90e3c1