Fix api path for s3 with gsub