move api call to model object