Moved class out to file.
Adding error message to rest error exception.