create a response object with the response code and merge it with the json output - might change this later