Updated unit tests with database and api