added REST functionality and mongodb