Updated to use php-api by Lquid.