Use loops to write headers to client.