add middlewarify package
update entity base class
update mongo entity driver