Add tests and DB implementation