Fixed wrong response on adding or editting objects and fixed objects not being saved.

I've added a couple of buttons to the add and edit templates. I've also changed form.validate() to form.validate_on_submit() as adding objects didn't work due to the form not being populated by request.form.