Better API query class.