Changed the way 404s were handled, added test cases