write to couchdb with admin priviledges
fixed file validation for xml and json