Implemented error classes.
Removed InternalError class.
Added utils for throwing errors and parsing json.
Added error handling and response parsing.