How do I learn API design? Hi everyone! I am a second-year CSE student. I should mention I code in C++, Java and am learning (still at the beginner level) Ruby. I've wondered for a while about how I could go about implementing a basic web-based API.

Say I want to design a service where I receive a request with a country code/name, and return data about different countries, like their population, capital, languages and currency. I want it to be sent as a JSON response.

1. How do I implement this? 
2. If I want to design this service for developers to use while programming in, say, Java and Ruby, will I have to I re-write the service appropriately?


Thanks!