locate: improve handling by modernising the API