Don't manually construct JSON. Also, don't encode html entities before json_encode-ing