Developing API methods to return JSON
Personally I prefer avoiding such nested if-else constructs, simply by reversing the logic, e.g.:

if(!cond1)
    return value;
if(!cond2)
    return value2;
// etc.


instead of:

 if (cond1)
     if(!cond2)
         return value2;
 else
     return value;