some fixes, database backend implementation