mongodb for trends and several model fixes