Convert id in fetch(id) to integer before passing to fetch_by_id

@hornairs @camilo 

This'll turn some attempted sql injection cases from 500s into 404s, so we don't get errorspam :)

Any issues with this?