Refactor rest extension. Remove rest annotation. Add extension factories