switch to mux and add trailing slash support