Add histories controller code