Added helper method to return search results as JSON (#940)