Adding support for REST_DEBUG env variable.