Added success and fail redirect logic, updated tests