Added a check to see if curl acturally succeeded

Signed-off-by: Antanas Norkus <antanas.norkus@cern.ch>