added db methods and local db to store viewed words