Refactored json rendering for autocomplete