added simpler c/c++ api wrapper