Marshals data from db to json and sets response header to content-type application/json