Fixed Curl request to work with parameter contains spaces and minor code style fixes