Working with the DB

Signed-off-by: Kiril Nesenko <nesenko@gmail.com>