async task to make rest calls