Sample API application throws error after long idle time