Changed directory structure and normalized return values as JSON with HTTP status codes for errors