Added json_response to return data for all calls.
Added 201 check before parsing JSON

Also added an empty array if it's not 201, just so the property exists at least.
Up for 86d56ee. Parse data in switch construction.