made the rest api for the  autocomplete search bar