Conversion to class

Converted super function into class.
Removed all the unneeded code.
Added a separate code example for each API method.