First implementation of history api.