create api handler as a service