initializeApi method