(feat) add db connection to server file and refactor mongoose files. closes #4