better way of checking the request mimetype