Database work

Tests work