Added missing include.
Postgres function reset_all() to reset database.
Error handling plus minor changes.