API now uses exceptions