added api service, refactor, work on integration