Add some API failsafes