Method 2

Approach to render output in json and html at the same time depending on
the request. For Eg using curl we can get output in json, while normal
browser requests in html.