     get_kernel_data: (cb) =>   # cb(err, kernel_data)  # see below.
         get_kernel_data(cb)
 
-    complete: (opts) =>
-        opts = defaults opts,
-            code       : required
-            cursor_pos : required
-            cb         : required
-        dbg = @dbg("complete")
-        dbg("code='#{opts.code}', cursor_pos='#{opts.cursor_pos}'")
+    call: (opts) =>
+        opts = defaults opts,
+            msg_type : required
+            content  : {}
+            cb       : required
         @_ensure_running (err) =>
             if err
                 opts.cb(err)
             else
-                @_complete(opts)
-
-    _complete: (opts) =>
-        if @_state == 'closed'
-            opts.cb('closed')
-            return
-        dbg = @dbg("_complete")
+                @_call(opts)
+
+    _call: (opts) =>
         message =
             header:
-                msg_id   : "complete_#{misc.uuid()}"
+                msg_id   : misc.uuid()
                 username : ''
                 session  : ''
-                msg_type : 'complete_request'
+                msg_type : opts.msg_type
                 version  : '5.0'
-            content:
-                code       : opts.code
-                cursor_pos : opts.cursor_pos
+            content: opts.content
 
         # setup handling of the results
         if opts.all

            detail_level : required
            cb           : required
        dbg = @dbg("introspect")
        dbg("code='#{opts.code}', cursor_pos='#{opts.cursor_pos}'")
        @_ensure_running (err) =>
            if err
                opts.cb(err)
            else
                @_introspect(opts)

    _introspect: (opts) =>
        dbg = @dbg("_introspect")
        message =
            header:
                msg_id   : "introspect_#{misc.uuid()}"
                username : ''
                session  : ''
                msg_type : 'inspect_request'
                version  : '5.0'
            content:
                code         : opts.code
                cursor_pos   : opts.cursor_pos
                detail_level : opts.detail_level

        # setup handling of the results
        if opts.all
            all_mesgs = []

        f = (mesg) =>
            if mesg.parent_header.msg_id == message.header.msg_id
                @removeListener('shell', f)
                mesg = misc.deep_copy(mesg.content)
                if misc.len(mesg.metadata) == 0
                    delete mesg.metadata
                opts.cb(undefined, mesg)
        @on('shell', f)

        dbg("send the message")
        @_channels.shell.next(message)

    http_server: (opts) =>
        opts = defaults opts,

            when 'signal'
                @signal(opts.segments[1])
                opts.cb(undefined, {})

            when 'kernel_info'
                @kernel_info(cb: opts.cb)

            when 'complete'
                code = opts.query.code
