API class refactor