Create API for fence.register, and use it.