redirect appropriately on form submit based on API responses