Added mongoose and converted database to mongoose