improved exception handling
fixed possible NPE: getResponseBodyAsString could return null
throw ApiResultException when the response is empty to revalidate the session

After using the same instance of XMLApiClient for a while, we often saw some ApiException in the logs, because the response had no content.
We believe that the session was expired or otherwise invalid, but the XMLApiClient did not recover from this state. This should now be fixed, because
in case of an empty content the session will now be restored and the command repeated.
new internal version