moved apiclient properties to the constructor