add api factory