[Minor] reorganized classes for Agent into api and impl packages