Updated error response, added automatic validation, added functions for retrieving information from responses