Why use api in the foreach and this.api in the line below?

Same comment for below and wherever else this might be done.