Fix file import method

Fixes #3

Also:
- clean up payload validation code
- Raise for methods that don't return errors