most complete version of CRUD with db, but still doesn't work