main function routes requests to function