Added REST method to get error msg if an error occurs
Changed error_msg to a single error message instead of array