first draft of the new rest methods related to issue #125
everything now works but the code needs some cleaning up
fixes 125
Merge branch 'master' into ajax-stats