rewrite deliveries api controller