updated mongoose

various small fixes and a minor api change