Replaced Api functions with OOP