got rid of extra calls to api factory