* API: Restructured to allow internal usage. Error handling cleanup.