Write the entire response to stack

Previously we were just writing the header to the stack
Use a struct buffer to store the response