Minor Posts fixes

* Whitespace fixes
* Fix handling of form_id in posts api: no PHP error if missing
* Only check parent exists if not empty