Initial commit of KB API code.