Code was cleaned up. Logging statements and API comments were added.