Added feature: logging input and output to MongoDb