Feature/add node api

should move this into the try block. Otherwise, if there's an error writing we'll write to the responder once for the error and then again here (which will result in an exception)