added error and index templates to render the json as a string