I have been given a task to take on a legacy application (which has a very poor API in terms of user experience, is undocumented largely, and performs slowly) and build a new API and SDK to improve the user experience. I have access to the source code of this legacy application and I can see only one endpoint which does everything.
I would like to know the best way to wrap a new API that improves user experience for a legacy application. These are some of things I have thought about:
- Design the API so that it follows REST principles
- Document the API using something like RAML/Swagger etc
- Improve the user experience of the API so that they can enter query data much more easier such as specifying it in a JSON payload rather than as query parameters in the URL (as is with the legacy application)
- Generate tests to query all permutations and so exercise as much as possible the underlying legacy service.
- Some sort of regression testing framework to make sure the new API does not break the legacy app by working outside it's constraints.
One thing which troubles me is how to best communicate with the legacy webservice? I would have to translate the JSON from my webservice to a query which the legacy API accepts. What are the best practices around that?
Any other suggestions which I have missed would be appreciated.