rest implementation