Added check on curl response
Merge pull request #377 from stefk/curl-check

Added check on curl response