implement basic db-based MVC and corresponding js