this class needs to be refactored to use Synapse Java client