more refactoring - test to/fromJSON for mimetypes