set appropriate mime type for resource