implemented wait and error functions for futures in the C api