use opaque pointer, update functions for initial api