first working version of rest api