Some days, the lottery will take longer to complete the draw. The API is used to obtain the data. Once the draw time is reached, the API is consulted to obtain the hash of the last block Bitcoin. Then, the API is consulted again to obtain detailed information on this block and thus obtain the nonce value. The delay of the draw is due to the fact that the second call to the API is sometimes wrong. In this case, the API is consulted until the desired information is obtained. Either the API is overloaded, or the block is too recent for the API to publish information about it. It may take a few extra minutes to finalize the draw, but this delay does not affect the result since the block was targeted at the scheduled time.