Fixing bug in server when id is null.