Object-oriented PHP API