replace placeholders before response