history API for backend