Added test case, and rest controller