pretify and work on history api