Frappe get_doc not working

I have created an API method as below

def createFarm(company):
#Create New Farm
new_farm = frappe.get_doc({
“doctype”: “Farm”,
“name”: company,
“company”: company
except Exception as err:
return err

when i pass an existing company like below

the output is as follows

// 20171122101730

“message”: “Upande LTD”

when i refresh the api resource Farm the array doesn’t reflect the new Farm record, it is as if it is not saved into the database

// 20171122101733

“data”: Array[0][


Post this on: