this way the user can see when an invalid input is given
Create OC_JSON class, for single point of creating json responses. No real logic change, this just cleans up the code a bit.