Replace the hand made API with Grape one