Make sure invalid statements are caught

Closes #231
Fix regex for MRI ruby

It's error message has a couple extra spaces
Add integer regex constraints to all id routes
Extract id regex to constant
Merge pull request #241 from edpaget/fix-string-id-crash

Fix string id crash