implement api-doc as a common filter

This way makes the user to write a handler and add this filter
on it in order ty generate documents. But it gives the users
much more flexible.