Updated error handling for API call
Added loading spinner for the autocompletion