Better API for fetch_filetype/fetch_mimetype