Made REST API more robustly handle shift requests