rewrite content-type dispatch using mimeparse library