[API] Improve the error management and the description of returned error.