Added the capacity to decode JSON from php://input

If you transmit data using Content-Type: application/json, we need to decode the JSON data to an array, fallbacks to string if it's not a valid JSON string.

Also, I've changed $_REQUEST for $request_params since we already affect that variable with the request method data.