fixed apiRemaining to console log