database - implemented basic functionality