Replace `serialize` with `json_encode`, see #5