404 error
use global apis

otherwise, api will always be the last api in main.foreach