An API request can either by successful or not. The best way to explain how to check for this is through code so let's go through it.
<?php $response = $api->get('/levels'); $response = unserialize($response); if($response['success']==1){ echo 'Request successful'; // do stuff here } else { echo 'Request failed'; echo '<br />'; echo 'Error Code:' . $response['ERROR_CODE']; echo '<br />'; echo 'Error Description:' . $response['ERROR']; } ?>