Fix broken apexRest endpoint and add apexRest test.