Added id field to API.
Massive cleanup and removal of many unused parts.