Revert "Fix json serialization properly"

This was the right fix but only works for php version 5.4

This reverts commit 6866be551920f1c7909a07e7ab8f89a70cff250d.