API caller, update code to get the license correctly

Get license key from local configuration file
API Caller, fixed a bug

The xml extracted out would be incorrect sometimes, fixed this.