adding the search and json refactor