History API (first pass, needs refinement)