updated factory and api endpoint