Reorganize API methods.
Added some docs.
Added first unit tests. Refactor Api class with factory.