move to strictly rest api, add tests