Fixed the rest api to be compatible with the unit tests again.