better content-type handling, added missing import