     catch error
       @send error
 
-  _handleLastBuildStatus: (err, res, body, server) =>
+  _handleLastBuildStatus: (err, res, body, server, folder) =>
     if err
       @send err
       return

    if !server
      @msg.send "I couldn't find any servers with a job called #{@_getJob()}.  Try `jenkins servers` to get a list."
      return
    @_requestFactorySingle server, path, @_handleLast

  list: (isInit = false) =>
    @_requestFactory "api/json", if isInit then @_handleListInit else @_handleList

  listAliases: =>

    job = @_getJob()
    server = @_serverManager.getServerByJobName(job)
    path = "job/#{job}/#{lastBuild.number}/api/json"
    @_requestFactorySingle server, null, path, @_handleLastBuildStatus

  _requestFactorySingle: (server, folder, endpoint, callback, method = "get") =>
    user = server.auth.split(":")
    if server.url.indexOf('https') == 0 then http = 'https://' else http = 'http://'
    url = server.url.replace /^https?:\/\//, ''
    path = "#{http}#{user[0]}:#{user[1]}@#{url}/#{endpoint}"
    console.log(path)
    request = @msg.http(path)
    @_configureRequest request, server
    request[method]() ((err, res, body) -> callback(err, res, body, server, folder))

  _requestFactory: (endpoint, callback, method = "get") =>
    for server in @_serverManager.listServers()
      @_requestFactorySingle server, server.getFolder(), endpoint, callback, method

  _setJob: (job) =>
    @msg.match[1] = job
