update request-response and code refactor