refactor apis/resources/base.py

change % operator to str.format
change dict to {}
add tests for V2 apis