added historyApi mode code and documentation