use api for ranges