change the C API to accommodate the Python API