all: clean the database on TearDownSuite's
api: don't rely on error message from the json package

This message changed on tip :-)
db: improve tests

The compiler already guarantees the return type of a function, we should
not make that kind of assertion in the runtime, even on tests.