Make curl fail if the HTTP response is not 20x
Get rid of the lock and integrate with Jenkins