WordPress JSON API remove posts from a specific category

I found a solution. You have to go to the folder controllers/core.php and there you have to change the function get_recent_posts().
You have to add this code to remove categories that you don’t want:

public function get_recent_posts() {
global $json_api;

// get all the categories from the database
        $cats = get_categories(); 

            // loop through the categries
            foreach ($cats as $cat) {
                // setup the cateogory ID
                $cat_id = $cat->term_id;

                // create a custom wordpress query
                query_posts("cat=-434,-22837,-13571,-1,-18,-17385");
                // start the wordpress loop!

                while (have_posts()) {
                $posts = $json_api->introspector->get_posts();  
                return $this->posts_result($posts);
                }
           } 

  }

error code: 523