Magister API class for PHP