added error messages, 404 handling