Added routes and sql query for running average