remove require_once & use https for rest endpoint