             @emit 'error', { msg: 'failed to load profiles'}
 
     _onChannels: (data, headers) =>
-        if data
+        if data && not data.error
             @channels = data.members
             @logger.debug 'Found '+Object.keys(@channels).length+' channels.'
             @channel_details = data.channels

            @emit 'error', { msg: 'failed to load teams.' }

    _onProfiles: (data, headers) =>
        if data
            @users = data
            @logger.debug 'Found '+Object.keys(@users).length+' profiles.'
            @emit 'profilesLoaded', { profiles: @users }

            @reconnect()

    _onInitialLoad: (data, headers) =>
        if data && not data.error
            @teams = data.teams
            @logger.debug 'Found '+Object.keys(@teams).length+' teams.'
            for t in @teams
