Fixed setup for recommendations API

Also switched arguments loop to use lodash.forEach since it is faster
and safer
I would consider this a bug at the API level - maybe you can't control this, but FWIW.