added Angularjs support.
more robust mongo connection.