Reworked API and a few updates.