Fixed a bug that prevented the service dialog from sending JSON
Refactored light to be more reusable