api.stop = function(cb) {
    api.once('stopped', function() {
      cb();
    }).once('timeout', function(event) {
      cb(new Error(format('Timedout while waiting for %s task to stop', event.name)));