adding content header and length for json output