Rewrote routes in javascript