When you grunt server:dist, the stub won't be used because Grunt runs expressServer:dist:keepalive and then that sets apiMethod to keepalive.