Added some trial code to connect to the mongodb - need to consider whether to use synchronous approach