refactor work and addition of mock api