added the routines for interpretting errors from the C api