add ReflectionException handling

- add http_response_code function