Set headers before sending response back to the client