Code for Rest learning