Theoretically speaking, if I know programming (C,C++,C# etc.) can I write my own mining pool software/server using only Bitcoin API or I need more information than that?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
You can, of course! But you may start from some existing programs that do what you say, most are open source and well documented. And ask someone, it's very hard to do it on your own!
https://github.com/CoiniumServ/CoiniumServ is an open source c# pool implementation which could be a good starting point.