add test for writeToResponse to demonstrate how to call the function