Add Error class

To make it easy for the users to catch errors originating from this
library, add an Error class.
Raise ServerError on JSON parse error