Added support for returning JSON with a custom status code