Unify API's error return types and fix various bugs

Merge request reports

Loading