Added support for repository server hook and improved tests