introduce new ApiClient which properly encodes URL parts

authentication of users and searching now uses new ApiClient