added model hook support; fixed http error output