Catch and log exceptions when sending client response
Return 500 status for unrecoverable exceptions
Add helper functions rmdir_p_iterative() and do_post_root()