Added a switch statement to switch between different web service methods.
Retrieves controllers and sensors.