improved erorr handling in api doc controller