added mongodb sample and refactored some server side setup