improve autocomplete API integration