Added database and integration tests for Media