Code movement, api.go created and all API functions moved to it
Bugfix in params parse