wrap rest API into a service