 
   markUserAsExempt: secure (client, exempt, callback)->
     {delegate} = client.connection
-    if delegate.can 'flag', this
+    return callback new KodingError 'Access denied'  unless delegate.can 'flag', this
+
+    # mark user as troll in social api
+    @markUserAsExemptInSocialAPI client, exempt, (err, data)->
+      return callback new ApiError err  if err
       @update $set: {isExempt: exempt}, callback
       # this is for backwards comp. will remove later...
       if exempt

      else
        @update {$pullAll: globalFlags: ["exempt"]}, ()->

      # mark user as troll in social api
      @markUserAsExemptInSocialAPI client, exempt, (err, data)->
        console.error err if err

    else
      callback new KodingError 'Access denied'

  markUserAsExemptInSocialAPI: (client, exempt, callback)->
    {markAsTroll, unmarkAsTroll} = require './socialapi/requests'
    @createSocialApiId (err, accountId)->
      return callback err if err
      return callback {message: "account id is not set"} unless accountId

      if exempt

    return callback null, @socialApiId  if @socialApiId
    {createAccount} = require './socialapi/requests'
    createAccount {id: @getId(), nickname: @profile.nickname}, (err, account)=>
      return callback new ApiError err  if err
      return callback {message: "Account is not set, malformed response from social api"} unless account?.id
      @update $set: socialApiId: account.id, (err)->
        # check for error
