 
   vmOff: ->
     if not @recentState? or @recentState.state is 'RUNNING'
-      @vmUnprepareAndStop onProgress: (update) =>
+      @vmStopAndUnprepare onProgress: (update) =>
         @emit 'vm.stop.progress', update
     else
       Promise.cast true

class OsKite extends KDKite

  api = 
    exec            : 'exec'

    appInstall      : 'app.install'


    s3Store         : 's3.store'
    s3Delete        : 's3.delete'

    vmStart         : 'vm.start'
    vmPrepareAndStart: 'vm.prepareAndStart'
    vmStopAndUnprepare: 'vm.stopAndUnprepare'
    vmShutdown      : 'vm.shutdown'
    vmUnprepare     : 'vm.unprepare'
    vmStop          : 'vm.stop'
    vmReinitialize  : 'vm.reinitialize'
