bug fix to public autocomplete query
lots of bug fixes and enhancements
dubious commit
Revert "lots of bug fixes and enhancements"

This reverts commit c1c67696955c2dd1866f9a6ad0d2dc6a0e5c3c0f.