working on refactoring to use mongoose and q (promises)