api: added test with error from the repository handler.