package refactoring: moved db access to server; created shared model