Added FOREACH macro + API change