add base router implementation taken from Express