db creation and barebones db functions