API for history rewrites