Added pin tests
Refactor tab AJAX requests. Added tab tests.