Update with new schema and more database commands. Also improve the front end