Writes docs for api