Finished mongodb integration