Refactor rest players send request function