Rewrite server and resource in Scala.