moved restclient call from main to rb