getError, setters

getError() will return the private variable error. Added setters for the
private variables of the class too