MUCH more safey in c_api.cpp, std::string(NULL) crashes!