he had started as an insurance salesman and had become a successful songwriter , with songs such as `` the broadway melody , '' `` good morning , '' `` on a sunday afternoon , '' and `` singin ' in the rain . ''