Add extern "C" around API to enable C++ linking