You might want a guard clause here to not actually send to the server in certain modes, but not sure where you are doing this.

It is OK to leave this here, now, but I'd recommend moving this out of the controller.  As we've discussed, controllers are hard to test and you want to move this kind of stuff out of the controllers so they are easier to test.