pkgdb2client: Remove duplicate code to call the API

The new call_api() method includes the generic API call code that can be
used by all API wrapper methods and to call non-wrapped API methods.