Made the error messages specific to the what was happening when the query failed in API.PHP