Refactoring after review.
bugfix: opening file in client side may fail.
Doc strings. Strong refactoring.
bugfix: filename check moved to inner layer.
bugfix: import sys module in client.
Separate message for 202.
Merge pull request #4 from MihaiTabara/staging

Staging