Improved return code handling

The "switch ($return['code'] == -1) {}" only returns true or false, not the integer you're expecting in the switch.
You should also check the null case when handling json_decode which means the php code of the apc flusher hasn't run.
Merge pull request #2 from alex88/patch-1

Improved return code handling