improve referential integrity checks and error messages
add list_all to controllers
fix typo