       return callback err if err
       return callback null, mapActivities result
 
-  message:
-   edit                  :(rest...)-> messageApiFunc 'edit', rest...
-   post                  :(rest...)-> messageApiFunc 'post', rest...
-   reply                 :(rest...)-> messageApiFunc 'reply', rest...
-   delete                :(rest...)-> KD.remote.api.SocialMessage.delete rest...
-   like                  :(rest...)-> KD.remote.api.SocialMessage.like rest...
-   unlike                :(rest...)-> KD.remote.api.SocialMessage.unlike rest...
-
   mapActivities = (messages)->
     # if no result, no need to do something
     return messages unless messages
     # get messagees from result set if they are not at the first level
     messages = messages.messageList if messages.messageList
-    messages = [].concat(messages);
+    messages = [].concat(messages)
     revivedMessages = []
     {SocialMessage} = KD.remote.api
     for message in messages

        return callback err if err
        return callback null, mapChannels result

  channel:
    list               : fetchChannels
    fetchActivity      : fetchChannelActivity
    fetchGroupActivity : fetchGroupActivity
    fetchPopularTopics : fetchPopularTopics
    listPinnedMessages :(rest...)-> channelApiFuncMultiRes 'listPinnedMessages', rest...
    pin                :(rest...)-> KD.remote.api.SocialChannel.pinMessage rest...
    unpin              :(rest...)-> KD.remote.api.SocialChannel.unpinMessage rest...

  messageApiFunc = (name, rest..., callback)->
    KD.remote.api.SocialMessage[name] rest..., (err, res)->
      return callback null, mapActivity res

  constructor: (options = {}, data) ->
    super options, data

  message:
    edit                  :(rest...)-> messageApiFunc 'edit', rest...
    post                  :(rest...)-> messageApiFunc 'post', rest...
    reply                 :(rest...)-> messageApiFunc 'reply', rest...
    delete                :(rest...)->
      KD.remote.api.SocialMessage.delete rest...
    like                  :(rest...)->
      KD.remote.api.SocialMessage.like rest...
    unlike                :(rest...)->
      KD.remote.api.SocialMessage.unlike rest...

  channel:
    list               : fetchChannels
    fetchActivity      : fetchChannelActivity
    fetchGroupActivity : fetchGroupActivity
    fetchPopularTopics : fetchPopularTopics
    listPinnedMessages : (rest...)->
      channelApiFuncMultiRes 'listPinnedMessages', rest...
    pin                : (rest...)->
      KD.remote.api.SocialChannel.pinMessage rest...
    unpin              : (rest...)->
      KD.remote.api.SocialChannel.unpinMessage rest...

  getCurrentGroup = (callback)->
    groupsController = KD.getSingleton "groupsController"
    groupsController.ready ->
      callback  KD.getSingleton("groupsController").getCurrentGroup()

  fetchChannelActivity = (options, callback)->
    unless options.id
      return callback {message: "Channel id is not set for request"}
    getCurrentGroup (group)->
      options.groupName = group.slug
      channelApiFuncMultiRes "fetchActivity", options, callback

  fetchGroupActivity = (options, callback)->
    getCurrentGroup (group)->
      unless group.socialApiChannelId
        return callback {message: "Group doesnt have socialApiChannelId"}
      options.id        = group.socialApiChannelId
      options.groupName = group.slug
      channelApiFuncMultiRes "fetchActivity", options, callback
