     catch e
       logger.error 'job.start: ', e
 
-    return response:
-             status: 'ok'
-
-  job_resume: (data) ->
+    respond response:
+              status: 'ok'
+
+  job_resume: (data, respond) ->
     if @job
       try
         @job.resume data.creds
-        return response:
-                 status: 'ok'
+        respond response:
+                  status: 'ok'
 
       catch e
-        return response:
-                 status: 'error'
-                 error: e.toString()
-
-    else
-      return response:
-               status: 'error'
-               error: "No running jobs"
-
-  job_status: (data) ->
+        respond response:
+                  status: 'error'
+                  error: e.toString()
+
+    else
+      respond response:
+                status: 'error'
+                error: "No running jobs"
+
+  job_status: (data, respond) ->
     unless @job
-      return response:
-               status: 'error'
-               error: "No running jobs"
-
-    response:
-      status: 'ok'
-      'job.status':
-        status: @job.status
-        result: @job.result
-        data: @job.data
-        jobid: @job.jobid
-        fid: @job.fid
-        completed: @job.done
-        cookies: cookies.dump()
-        timestamp: new Date().getTime()
-        version: @job.version
-
-  statement_list: (data) ->
+      respond response:
+                status: 'error'
+                error: "No running jobs"
+    else
+      respond response:
+                status: 'ok'
+                'job.status':
+                  status: @job.status
+                  result: @job.result
+                  data: @job.data
+                  jobid: @job.jobid
+                  fid: @job.fid
+                  completed: @job.done
+                  cookies: cookies.dump()
+                  timestamp: new Date().getTime()
+                  version: @job.version
+
+  statement_list: (data, respond) ->
     statements = Dir.profile.child 'statements'
     list = []
 

            requestText = @request[0...index]
            @request = @request[index+1..]

            request      = json.parse requestText
            response     = @dispatch request
            try
              responseText = "#{json.render response}\n"
              log.radioactive responseText
              outstream.write responseText, responseText.length
            catch e
              log.error e
      }, null)

  onStopListening: (serv, status) ->
    logger.debug "Controller#onStopListening"

  dispatch: (request) ->
    request.action = request.action.replace /\./g, '_'
    tryCatch 'Controller#dispatch', (log) =>
      if type.isFunction @[request.action]
        @[request.action]?(request.body)
      else
        message = "Unrecognized request action #{inspect request.action}"
        log.error message

        response:
          status: 'error'
          error: message

  job_start: (data) ->
    try
      throw new Error "Got unexpected type: #{typeof data}" if typeof data isnt 'object'



      pump = Cc['@mozilla.org/network/input-stream-pump;1'].createInstance(Ci.nsIInputStreamPump)
      pump.init(stream, -1, -1, 0, 0, false)
      pump.asyncRead
        onStartRequest: (request, context) =>
          log.radioactive this
          @request = ''
