Add API docs. Dirname of url as fallback filename.