Fixes incorrect curl command, captures errors