add validator for model
add attributes for setting and add init_database function for application.py