separated api and service