Here are a few small suggestions --
Standardize capitalization of acronyms. Is it "JSON" or "Json"? My recommendation is all caps, including "API" instead of "Api"
Develop a consistent naming convention. You have a tendency to throw in extra underscores in some instances. For example, __WD_Capabilities_Switch_Parameters should be __WD_Capabilities_SwitchParameters so that it matches the format of __WD_Capabilities_CreateObject.
Removing the underscore after _WD_Capabilities would better match the naming convention used in the main WD UDF 😉