I had this code working and now I am getting a 404 not found error.
I see this in the message:
bundle=serverclass stanza=serverClass:Test The sourceApp=system doesn't equal callerApp=search
args: whitelist.0= host1
Try using the edit REST endpoint for server class.
See if it works for you.