 
 API.job.create = (job) ->
   job = job_job.get(job) if typeof job isnt 'object'
+  job._id = job_job.insert(job) if not job._id?
   job.processes ?= []
   job.count = job.processes.length
   # A job can set the "service" value to indicate which service it belongs to, so that queries about jobs only related to the service can be performed

  job = job_job.get jobid
  job.user = uid if uid
  job.refresh = 0
  job._id = job_job.insert {new:true, user:job.user, processed: 0}
  Meteor.setTimeout (() -> API.job.create job), 2
  return job:job._id


      rs = job_process.find({'signature.exact':proc.signature}, true) if not rs?
      if rs
        proc._id = rs._id
        try
          rs.job.push job._id
          try job_process.update rs._id, {job: rs.job}
          try job_processing.update rs._id, {job: rs.job}
          try job_result.update rs._id, {job: rs.job}
      else
        proc._id = Random.id()
        imports.push proc
