Add validation of incoming json data and add correct return messages