table: fix wrong table names and scope issues
counter: fix scope issue
database: implement destroy