api class turned into singleton classs