build api class