Implement db access via services
Migration fixes