refactored
commented http and php error codes
refactored
refactored