     if command in ['start', 'stop', 'getstatus']
         req = { protocol: 'network', command: command, payload: payload }
         return sendMessage(runtime, req).then (resp) ->
-          sendAck connection, resp
+          return resp
     else if command in ['debug']
         # does nothing relevant, response not expected
         return Promise.resolve()

        isMainGraph = payload.name == runtime.namespace + '/' + runtime.graph.name
        p = if isMainGraph then getGraphSource(runtime) else getComponentSource(runtime, payload.name)
        return p.then (payload) ->
          sendAck connection, { protocol: 'component', command: 'source', payload: payload }
    else
        return Promise.reject("Unknown FBP command component:#{command}: #{payload}")
    return

sendAck = (connection, msg) ->
    delete msg.payload.secret
    connection.send msg

handleGraphCommand = (command, payload, connection, runtime) ->
    request = { protocol: 'graph', command: command, payload: payload }

        runtime.exportedEdges = []
        runtime.edgesForInspection = []

        return sendMessage(runtime, request)
    else if command is "addnode"
        graph.processes[payload.id] = payload
        graph.componentMap[payload.id] = payload.component
        # TODO: respect nodeId from runtime
        graph.nodeMap[payload.id] = { id: graph.currentNodeId++ }
        return sendMessage(runtime, request).then (response) ->
          return response

    else if command is "removenode"
        return sendMessage(runtime, request).then (response) ->
          delete graph.processes[payload.id]
          delete graph.nodeMap[payload.id]
          delete graph.componentMap[payload.id]
          return response

    else if command is "renamenode"
        node = graph.processes[payload.from]
        graph.processes[payload.to] = node
        return sendMessage(runtime, request)
    else if command is "changenode"
        # FIXME: ignored
        return Promise.resolve(request)
    else if command is "addedge"
        graph.connections.push protocol.wsConnectionFormatToFbp(payload)
        return sendMessage(runtime, request)
    else if command is "removeedge"
        graph.connections = connectionsWithoutEdge(graph.connections, protocol.wsConnectionFormatToFbp(payload))
        return sendMessage(runtime, request)
    else if command is "changeedge"
        # FIXME: ignored
        return Promise.resolve { protocol: 'graph', command: command, payload: payload }
    else if command is "addinitial"
        graph.connections.push protocol.wsConnectionFormatToFbp(payload)
        return sendMessage(runtime, request).then (response) ->
          return Promise.resolve(request) # TODO: use response from RT
    else if command is "removeinitial"
        # TODO: send to runtime side, wait for response
        graph.connections = connectionsWithoutEdge(graph.connections, protocol.wsConnectionFormatToFbp(payload))
        return Promise.resolve(request)

    else if command is "addinport"
        graph.inports[payload.public] =
            process: payload.node
            port: payload.port
        sendExportedPorts connection, runtime
        return Promise.resolve(request)
    else if command is "removeinport"
        delete graph.inports[payload.public]
        sendExportedPorts connection, runtime
        return Promise.resolve(request)
    else if command is "addoutport"
        graph.outports[payload.public] =
            process: payload.node
