Merged with apimock functionality (for developing testing)