Better logging and status handling
Created StatusCode enumeration