Moved all sqlite3: calls under db:with-db to enforce using mutex when many parallel api calls