added rudimentary 404 and other error handling