basic work with db and fix some front-end bugs