Also accept json as input