add mongoose schemas, optimize view fordata construction.