I need your inputs in writing the JavaScript function which takes the JSON response data from the REST API call and updates the response by removing certain elements based on co