corrected couple of errors
API finalized, error-fixing

API should be all as is. Needs testing.