'POST /api/forms
Creates a new form.'

@web.expose_api
def create(self, trans, payload, **kwd):

    if (not trans.user_is_admin()):
        trans.response.status = 403
        return 'You    are    not    authorized    to    create    a    new    form.'
    xml_text = payload.get('xml_text', None)
    if (xml_text is None):
        trans.response.status = 400
        return "Missing    required    parameter    'xml_text'."
    form_definition = form_factory.from_elem(XML(xml_text))
    trans.sa_session.add(form_definition)
    trans.sa_session.flush()
    encoded_id = trans.security.encode_id(form_definition.id)
    item = form_definition.to_dict(view='element', value_mapper={'id': trans.security.encode_id, 'form_definition_current_id': trans.security.encode_id})
    item['url'] = url_for('form', id=encoded_id)
    return [item]
