Perform numeric check when returning JSON in the API