modified to use json template from s3