Fix invalid JSON crashing the server