added docstring and fixed Content-Type