Fix php warning if index page is requested
Small tidy up
Support for error codes and cache control
Additions to the validation class