Html and json encoding