Add Mongodb logic and tests