Make APIWrapper functions more type safe.