Fix and improve API.

All modifications from today