modified response parsing to utilise new headers array