This sounds as a good approach: "Ideally I would extend the TaskClient class and provide my own methods working in the same way as the existing ones. "
The query method was deprecated, because "it allows you to do any query on the database and can be harmful from the security point of view". I'm not completely agree with that Deprecation, but this is how it is right now.
Let us know how it goes with the extension.