Updated with unit testing. Rest assuered is used for unit testing.