updated the code to work with Apigility v1.0.0