Added test file endpoints and refactored errors (minor)
Updated API doc