added helper functions to send 404, serve files, check cache