alter C++ API, add C API, example code