FIX: Rest api function added

Unit test is added.