Updated autocomplete code to use json_encode (avoids errors associated with apostrophes and such.