added mongo handling and basic tests