added handling of invalid id in params

It was raising err when params didn't have key :id or the value of it was nil.
It was also getting active record error for nonsense input or invalid id numbers, which was unexpected.
Added a test for that and switched back to the original if-else block in the controller to include check that the id exists before trying to find on it. 

The tests need some DRYing out still. If I get a chance I'll do that.