much better restfull api. needs many tests