404 page and middleware basic auth api