abstract classes in api4kb

some method implementations are moved to the abstract classes for reuse.