specifying function for each of the routes