Move api call to service