Cleaned up PHP API