PHP API base classes