add config to client
fixup! temp - memory management
memory leaks fix on client and tests
fix cycle retained memory leak