Added debug option and request listener