[DF-4577] Implemented almost all unit tests. Corrected timeout handling and some small errors. Extended CURL error handling.