Disambiguating function names, reintroduce error_code parameter for get_locality_id()