moved rest client default setup into its constructor.