Every api call is in separate function the same way zone and structure handlers are organized. Should not contain any functional changes, tested locally and at least call scene and set value are working properly.
This is cleanup before implementing #15192 - new JSON API call for device interface.