Completed getClient function