add mime type and content length handling