Added a check to the PinID in the rest api function

If pin_id doesn't contain any of the expected char's then just return 0
Changed the PinID Check to check for hex values
Added a check on the data for rest api but broke the pin id check.

Doh
Fixed the bugs...

A) I'm an idiot.
b) In the data check I was looking at the pin id var instead of data. Dob
c) changed the if statements to use the decimal values