refactored server vars init and response headers init