Fixed bug in execute method, removed bool value for json_encode/json_decode, and tidied up