added some statistics to the rest api, removed old code which fetches every result, now only the avg is returned