Best approach for creation of new REST endpoint to install modules

I need to create a new REST endpoint that will handle download and install module from bintary with reference to this thread: Add-On Manager download and install from add-on index feature needing help, but the problem is knowing where to start. Should I do this in, core or work with them both ?

cc @dkayiwa @suthagar23

@suthagar23 is doing this for modules using this ticket:

You could take a look at his ticket and pull request for some general ideas.

Your work will be along the same lines but dealing with OWAs. Therefore start by creating a ticket under the Open Web Apps JIRA project.

And the pull request will be for this repository:

Do you need to download and install module or OWA?

@suthagar23 I intend to download and install OWA’s and not modules. Sorry for not being explicit enough

So you need to access the Bintary end point from the Java level(inside the sever). I think, I already provided some samples Codes to integrate this feature. Have you look those codes?

@suthagar23 Yes, I am. Using them as a guide to implement the functionality. Would get back to you if anything seems unclear. Thanks