I'm up to do a separate PHP controller for communication with API service. When it comes to JS I'd suggest waiting a bit more so we have more use cases and we could figure put the best way to write such a module. My proposal would be a single method which communicates with PHP controller and pass in params different controller method for different action.