Big refactoring and inclusion of new features for server side DB