Did partial PHP error handling (needs more work around $Ajax() )