fix routing on button click and history js
fix api URL