reorganized the packages, added api and delegate classes