Moved all API calls to API factory.