API: Added logging to error messages