Added success and error handling to add substation