added optional debug url command, also support for curl error handling