write docstring for part of the server api and make the macro nicer