making api request more safe