Additional unit tests added and controller logic modified