added headers and statuscode to output