Implemented kpiserver tests and finished the associated functionallity.