server side code for sensor lab