First working version with MongoDB