correct query bugs and add baseline PRD calculation and add mongodb