Refactor API #1

Extract logic from API to Request/Response class
[Exception] Inherit from StandardError instead of Exception
Refactor API #2

- Improve exceptions
- Clean up the API class
- Fix potential stack level too deep error
- Specs