Added logging configuration, and fixed  the device controller to sent a JSON response