Reorganized API

Now using standard function to output content, that includes content
size, etags and http status codes.