refer to APMG fork of phpsdk since that is what actually works