API V2 proposal.
copypaste mistake
changed api stucture based on feedback
refactored the json api additions a bit
merge of master into api_v2 branch