Added another rest get call and refactored code