fixed nbAttempts error on apiRequest