Minor REST update

*Fixed some minor bugs
*Changed code for MY_inflector_helper - there was a bug in the array
flipping which causes it not to work when we have keys with identical
values. This is now fixed.