added method to convert to form to JSON