fixed API so it would accept JSON directly instead of as a value of 'data' key