adding JS routing and handling