Refactored ajax call for searching clients