added several methods to work with database