Added register rest resource and tests.