Writes response.