Fixed issue with special characters in apiName

Escaping apostrophes and all other special characters uncopatibile with jQuery selectors.