add constructor and api handle