Refactor http_handler with more response codes.
Set http_handler.local_file only when got the definitive response code.
Refactor code.