converted to use REST API