add API factory Main controller