added the sending of json data to the database layer