Add /api/exit method for exiting application