Adds exception handling and return of the correct status tuple
Fixes syntatic issues discovered during testing