refactor data-access into common.api