Add support for json response as well as csv