Corrected bug where string was been converted to integer with intval function (due to copy paste of line of code). Added check to update if route exists when and before ccreating the rate and route.