update code and test for the latest resource spec