add database & gitignore
fix some bugs