           originId : account.getId()
 
         token.save (err) ->
-          return callback err  if err
+          return next err  if err
           token.username = account.profile.nickname
-          callback null, token
+          next()
 
     ]
 
-    daisy queue
+    async.series queue, (err) ->
+      return callback err  if err
+      callback null, token
 
 
   @create$: permit

hat           = require 'hat'
JGroup        = require './group'
JAccount      = require './account'
jraphical     = require 'jraphical'
KodingError   = require '../error'
{ permit }    = require './group/permissionset'
{ daisy
  secure
  ObjectId
  signature } = require 'bongo'



    queue = [

      (next) ->
        # validating data params
        unless account instanceof JAccount
          return next new KodingError 'account is not an instance of Jaccount!'

        JGroup.one { slug : group }, (err, group_) ->
          return next err                                 if err
          return next new KodingError 'group not found!'  unless group_

          unless !!group_.getAt 'isApiEnabled'
            return next new KodingError 'API usage is not enabled for this group.'

          groupObj = group_
          next()

      (next) ->
        limitError = "You can't have more than #{JGroup.API_TOKEN_LIMIT} api tokens"
        JApiToken.count { group : groupObj.slug }, (err, count) ->
          return next err                         if err
          return next new KodingError limitError  if count >= JGroup.API_TOKEN_LIMIT
          next()

      (next) ->
        # creating token
        token = new JApiToken
          code     : hat()
