Fixed security issue with API
Some API tests