I have created one API (jar) which I want to open source. I was hosting it then someone advised me to use some license. I googled it and found that I can apache License 2.0.
The Lesser GPL is closest to the Apache license, while the GPL and Affero GPL are rather different. It's definitely something to think about - what do you want to achieve with your project, how would you like people to use it, etc.