use process.nextTick() liberally to both shorten the call stack and ensure the API is always asynchronous