corrected thermostat plugin, server refactored