api.js
function recurse (obj, manifest, path, remoteCall) {
  for(var name in manifest) (function (name, type) {
    var _path = path ? path.concat(name) : [name]
    obj[name] =
        isObject(type)
      ? recurse({}, type, _path, remoteCall)
      : function () {
          return remoteCall(type, _path, [].slice.call(arguments))
        }
  })(name, manifest[name])
  return obj
}
function recurse (obj, manifest, path, remoteCall) {
  for(var name in manifest) (function (name, type) {
    var _path = path ? path.concat(name) : [name]
    obj[name] =
        isObject(type)
      ? recurse({}, type, _path, remoteCall)
      : function () {
          return remoteCall(type, _path, [].slice.call(arguments))
        }
  })(name, manifest[name])
  return obj
}
function recurse ( obj , manifest , path , remoteCall ) { for ( var name in manifest ) ( function ( name , type ) { var _path = path ? path . concat ( name ) : [ name ] obj [ name ] = isObject ( type ) ? recurse ( { } , type , _path , remoteCall ) : function ( ) { return remoteCall ( type , _path , [ ] . slice . call ( arguments ) ) } } ) ( name , manifest [ name ] ) return obj }
add all the api methods to the emitter recursively
add all the api methods to the emitter recursively