Added error handling for invalid JSON
Fixed findAll