Updated to use KpsAPI