allow to use 0 and 1 as boolean

I had some problems doing a web interface talking to the API, especially due to some boolean detected as string or integer in the API code.
This patch allow devs to send 0 and 1, they are used as boolean. If we send other values (string or >1), the default error is raised.