finish api wrapping.