initial working version of rest