Converted index template to return JSON