Merge pull request #2 from cesarramirez/master

Fixed small API error and updated with master branch
api.php now outputs JSON, not tested yet