added 404 handler, added logging
first part of rebuild