Uses interrupts instead of sleeping

Try to use interrupts instead of sleeping, and also handle HTTP exceptions better.

Not tested (!)