scala implementation of mock rest