New api

Don't pull yet, I want to make more changes. A review, suggestions and comments are already welcome!