Data api refactor