prevent panic if you use API in a wrong way
Merge pull request #2599 from dotcloud/prevent_panic_wrong_api_use

Prevent panic if you use API in a wrong way