add a init method for all api