Add type hinting and mimetype setting via filename extensions