fixed invalid cast in knp rest api