implements autocomplete function and passes all the specs for the function